
//O(n^2)
let arr = [23,1,323,42,12,634,87,4]
function bubbleSort(arr){
    for(let j=0;j<arr.length-1;j++){
        for(let i=0;i<arr.length-1-j;i++){
            if(a[i] < a[i+1]){
                [a[i],a[i+1]] = [a[i+1],a[i]]
            }
        }
    }
    return arr
}